$(document).ready(function(){
	var validator = $("#frmaddcms").validate({
		errorElement:'div',
		rules: {
			submenu_title: {
				required: true				
			},
			meta_title: {
				required: true
			},
			meta_keyword: {
				required: true
			},
			meta_description: {
				required: true
			}/*,
			submenu_content:{
				noSpace:true
			}*/
		},
		messages: {
			submenu_title: {
				required: "Enter menu title"
			},	
			meta_title: {
				required: "Enter meta title"
			},
			meta_keyword: {
				required: "Enter meta keyword"
			},
			meta_description: {
				required: "Enter meta description"
			}
		}
	});	
	
	// FCKEditor validation
/*	if(typeof jQuery.fn.fckEditorValidate == 'function') {
		jQuery.fn.fckEditorValidate({instanceName: 'submenu_content'});
	}*/
	
	
	/*jQuery.validator.addMethod("noSpace", function(value, element) { 
	alert(value);
		var s = FCKeditorAPI.GetInstance('submenu_content') ;
		var s1=s.GetXHTML();
		// var re = new RegExp(String.fromCharCode(160), "g");
		cleanText =replaceNbsps(s1);//replace(/^\xa0*([^\xa0]*)\xa0*$/g,"");
		alert(cleanText);
		//regex = /<(\?p(?=>|\s.*>))\/?.*?>/;
		//if(s.GetXHTML()==""||s.GetXHTML()==null || s1.match(regex) || s1.length==0){
		//	alert('empty');
		//}
		//isAllCharacters(
		var oEditor = FCKeditorAPI.GetInstance('submenu_content');
		text = oEditor.GetXHTML(true); 
		text.replace(/<\/?[^>]+(>|$)p &nbsp/g , "");	
		alert(text)
		if(text == '') 
		    return false; 
		else
			return false;		
 	 }, "Space are not allowed");*/
    

});

